From: Christoph Egger Date: Wed, 13 Apr 2011 13:14:59 +0000 (+0100) Subject: x86/svm/asid: Introduce svm_invlpga() X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a222899f96e72ba764338105fb57036282f56e27;p=xen.git x86/svm/asid: Introduce svm_invlpga() Signed-off-by: Christoph Egger --- diff --git a/xen/include/asm-x86/hvm/svm/asid.h b/xen/include/asm-x86/hvm/svm/asid.h index a484f3eff3..356a1cd023 100644 --- a/xen/include/asm-x86/hvm/svm/asid.h +++ b/xen/include/asm-x86/hvm/svm/asid.h @@ -34,10 +34,7 @@ static inline void svm_asid_g_invlpg(struct vcpu *v, unsigned long g_vaddr) { #if 0 /* Optimization? */ - asm volatile (".byte 0x0F,0x01,0xDF \n" - : /* output */ - : /* input */ - "a" (g_vaddr), "c"(v->arch.hvm_svm.vmcb->guest_asid) ); + svm_invlpga(g_vaddr, v->arch.hvm_svm.vmcb->guest_asid); #endif /* Safe fallback. Take a new ASID. */ diff --git a/xen/include/asm-x86/hvm/svm/svm.h b/xen/include/asm-x86/hvm/svm/svm.h index 920c9e29d3..9f0afd8478 100644 --- a/xen/include/asm-x86/hvm/svm/svm.h +++ b/xen/include/asm-x86/hvm/svm/svm.h @@ -60,6 +60,15 @@ static inline void svm_vmsave(void *vmcb) : : "a" (__pa(vmcb)) : "memory" ); } +static inline void svm_invlpga(unsigned long vaddr, uint32_t asid) +{ + asm volatile ( + ".byte 0x0f,0x01,0xdf" + : /* output */ + : /* input */ + "a" (vaddr), "c" (asid)); +} + unsigned long *svm_msrbit(unsigned long *msr_bitmap, uint32_t msr); void __update_guest_eip(struct cpu_user_regs *regs, unsigned int inst_len);